def zero_point(f,x,f_,flex):
    if f(x) == 0:
        return x
    x0=x
    x1=x0-f(x0)/f_(x0)
    while abs(x0-x1) > flex:
        x0=x1
        x1=x0-f (x0)/f_(x0)
        if f(x0) == 0:
            return x0
    return x1

def f(x):
    return x**3-2*x-5

def f1(x):
    return 3*x**2-2

print(zero_point(f,3,f1,10e-5))
